Class Objects.AIObject

AI object

Functions

GetPosition() Get the object's position
SetPosition(position) Set the object's position
GetRotationY() Get the object's Y-axis rotation To the best of my knowledge, the rotation of an AIObject has no effect.
SetRotationY(The) Set the object's Y-axis rotation To the best of my knowledge, the rotation of an AIObject has no effect.
GetName() Get the object's unique string identifier
SetName(name) Set the object's name (its unique string identifier)
AIObject:GetRoom() Get the current room of the object
AIObject:SetRoom(ID) Set room of object This is used in conjunction with SetPosition to teleport the object to a new room.
AIObject:GetObjectID() Retrieve the object ID
AIObject:SetObjectID(ID) Change the object's ID.


Functions

GetPosition()
Get the object's position

Returns:

    Position a copy of the object's position
SetPosition(position)
Set the object's position

Parameters:

  • position Position the new position of the object
GetRotationY()
Get the object's Y-axis rotation To the best of my knowledge, the rotation of an AIObject has no effect.

Returns:

    number the object's Y-axis rotation
SetRotationY(The)
Set the object's Y-axis rotation To the best of my knowledge, the rotation of an AIObject has no effect.

Parameters:

  • The number object's new Y-axis rotation
GetName()
Get the object's unique string identifier

Returns:

    string the object's name
SetName(name)
Set the object's name (its unique string identifier)

Parameters:

  • name string The object's new name
AIObject:GetRoom()
Get the current room of the object

Returns:

    int number representing the current room of the object
AIObject:SetRoom(ID)
Set room of object This is used in conjunction with SetPosition to teleport the object to a new room.

Parameters:

  • ID int the ID of the new room
AIObject:GetObjectID()
Retrieve the object ID

Returns:

    int a number representing the ID of the object
AIObject:SetObjectID(ID)
Change the object's ID. This will change the type of AI object it is. Note that a baddy will gain the behaviour of the tile it's on before said baddy is triggered. This means that changing the type of an AI object beneath a moveable will have no effect. Instead, this function can be used to change an object that the baddy isn't standing on. For example, you could have a pair of AIGUARD objects, and change one or the other two AIPATROL_1 based on whether the player has a certain item or not.

Parameters:

  • ID ObjectID the new ID

Usage:

    aiObj = TEN.Objects.GetMoveableByName("ai_guard_sphinx_room")
    aiObj:SetObjectID(TEN.Objects.ObjID.AI_PATROL1)
generated by LDoc 1.4.6 Last updated 2022-04-10 00:37:11